<template>
  <div class="scatter">
    <div class="tip color-f">{{$t('public.riskAlert1')}}{{symbolRisk}}{{$t('public.riskAlert2')}}</div>
    <div class="tip color-f">{{$t('public.riskAlert3')}}</div>
    <div class="tip riskAlertCheck">
      <el-checkbox v-model="checked1" disabled v-if="riskTipBoolean">{{$t('public.riskAlert4')}}</el-checkbox>
      <el-checkbox v-model="checked" v-else>{{$t('public.riskAlert4')}}</el-checkbox>
    </div>
    <div class="tip" style="margin-bottom: 10px;">
      <el-button class="btn" type="primary" @click="handleAgree">{{$t('public.sure')}}</el-button>
    </div>
  </div>
</template>

<script>
export default {
  name: 'riskHints', // 风险提示弹出框
  components: {
  },
  data() {
    return {
      checked: false,
      checked1: true,
      symbol: '',
    }
  },
  props: {
    symbolRisk: String,
    riskTipBoolean: Boolean,
  },
  watch: {
  },
  created() {
  },
  mounted() {
  },
  methods: {
    handleAgree() {
      this.$emit('listenRisk', false);
      if (!this.checked) {
        return;
      }
      const riskId = this.$store.state.app.trade.id;
      const riskStatus = JSON.parse(localStorage.getItem('riskStatus'));
      const riskBoolean = riskStatus.find(v => riskId === v);
      if (!riskBoolean) {
        riskStatus.push(riskId);
      }
      localStorage.setItem('riskStatus', JSON.stringify(riskStatus));
    }
  },
}
</script>

<style scoped lang="scss">
.theme-1B1D27 {
  .color-f {
    color: #fff;
  }
}
.scatter{
  text-align: center;
  padding-bottom: 8px;
  margin-top: -10px;
  color: #333;

  .tip{
    padding: 6px;

    .btn{
      width: 25%;
      font-weight: normal;
    }
  }
  .riskAlertCheck {
    margin: 20px 0 10px 0;
  }

  .what{
    overflow: hidden;
    width: 58%;
    margin: 0px auto;

    /deep/ .el-checkbox__label {
      padding-left: 5px;
    }
  }

  .mr200{
    margin-right: 20%;
  }

  .blue{
    color: cornflowerblue;
  }

  .color-999 {
    color: #999;
  }
}
</style>
